import { SketchImageService } from '@manycore/pages-vm-api';
import { ApiImpl } from 'message-lite';
import { getSelectedCustomModels, getSelectedElements, getSelectedModelCoverImage } from '../../util';

@ApiImpl()
export class SketchImageServiceImpl extends SketchImageService {
  async getCurrentImageUrl(): Promise<string | undefined> {
    const selectedModels = await getSelectedCustomModels(getSelectedElements());
    return getSelectedModelCoverImage(selectedModels);
  }
}
